.textOverflow() {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  word-break: break-all;
}

.textOverflowMulti(@line: 3, @bg: #fff) {
  position: relative;
  max-height: @line * 1.5em;
  margin-right: -1em;
  padding-right: 1em;
  overflow: hidden;
  line-height: 1.5em;
  text-align: justify;
  &::before {
    position: absolute;
    right: 14px;
    bottom: 0;
    padding: 0 1px;
    background: @bg;
    content: '...';
  }
  &::after {
    position: absolute;
    right: 14px;
    width: 1em;
    height: 1em;
    margin-top: 0.2em;
    background: white;
    content: '';
  }
}

// mixins for clearfix
// ------------------------
.clearfix() {
  zoom: 1;
  &::before,
  &::after {
    display: table;
    content: ' ';
  }
  &::after {
    clear: both;
    height: 0;
    font-size: 0;
    visibility: hidden;
  }
}

.layoutWrap {
  position: relative;
  @leftWidth: 400px;
  height: 100%;
  .clearfix();

  .leftWrap {
    position: absolute;
    width: @leftWidth;
  }
  .contentWrap {
    float: left;
    width: 100%;
    height: 100%;
    padding-left: @leftWidth + 10px;
    overflow: hidden;
  }

  &.collapsed {
    .leftWrap {
      width: 0;
    }
    .contentWrap {
      padding-left: 20px;
    }
  }

  .name {
    display: block;
    max-width: 200px;
    background-color: var(--bg-color);
    color: var(--font-color);
    padding: 4px 10px;
    .textOverflow();
  }
}

.searchTreeWrap {
  z-index: 1;
  width: 400px;
  margin-right: 10px;
}

.miniBar {
  width: 20px;
  color: var(--font-color);
  cursor: pointer;

  .barWrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    :global {
      .anticon {
        margin: 4px 0;
        font-size: 12px;
      }
    }

    &:before {
      border-radius: 7.5px 7.5px 0 0;
    }
    &:after {
      border-radius: 0 0 7.5px 7.5px;
    }

    &:before,
    &:after {
      width: 8px;
      height: 40px;
      background-color: rgba(0, 0, 0, 0.12);
      content: '';
    }
  }
}

.collapsedBtn,
.searchInput {
  margin-bottom: 10px;
}

:global(.dark) {
  .barWrap {
    &:before,
    &:after {
      background: rgba(255, 255, 255, 0.15);
    }
  }
}
